<?php
defined('BASEPATH') OR exit('No direct script access allowed');

/**
* 栏目模型
*/
class Column_model extends CI_Model{
	
	//添加栏目模型
	public function model_add($data)
	{
		$this->db->insert('editor', $data );
	}

	//查看栏目模型
	public function model_show(){
		$data = $this->db->get('editor')->result_array();
		return $data;
		//p($data);
	}

	//编辑栏目  
	public function model_editor($cid){
		//$data = $this->db->where(array('cid'=>$cid))->get('editor')->resurl_array();

		$data = $this->db->where(array('cid'=>$cid))->get('editor')->result_array();
		return $data;
	}
	// 修改栏目
	public function model_update($cid,$data){
		$this->db->update('editor',$data,array('cid'=>$cid));
	}
	//删除栏目
	public function model_del($cid){
		$this->db->delete('editor',array('cid'=>$cid));
	}
	
	//调取导航栏栏目
	public function column_limit(){
		$data = $this->db->get('editor')->result_array();
		return $data;
	}
}